import { datashopAxios } from '@/utils/request'

// 主题列表
export const reqDataThemeList = (params: any): Promise<any> => {
  return datashopAxios({
    url: '/api/datashop/v3/data-topics',
    method: 'get',
    params
  })
}
// 主题新增
export const reqDataThemeAdd = (data: any): Promise<any> => {
  return datashopAxios({
    url: '/api/datashop/v3/data-topics',
    method: 'post',
    data
  })
}
// 主题编辑
export const reqDataThemeEdit = (data: any): Promise<any> => {
  return datashopAxios({
    url: `/api/datashop/v3/data-topics/${data.id}`,
    method: 'put',
    data
  })
}
// 主题下架
export const reqRevokeDataTheme = (data: any): Promise<any> => {
  return datashopAxios({
    url: `/api/datashop/v3/data-topics/${data.id}:revoke`,
    method: 'post',
    data
  })
}
// 主题上架
export const reqPublishDataTheme = (data: any): Promise<any> => {
  return datashopAxios({
    url: `/api/datashop/v3/data-topics/${data.id}:publish`,
    method: 'post',
    data
  })
}
// 上移数据主题
export const moveUpDataTheme = (data: any): Promise<any> => {
  return datashopAxios({
    url: `/api/datashop/v3/data-topics/${data.id}:move-up`,
    method: 'post',
    data
  })
}
// 下移数据主题
export const moveDownDataTheme = (data: any): Promise<any> => {
  return datashopAxios({
    url: `/api/datashop/v3/data-topics/${data.id}:move-down`,
    method: 'post',
    data
  })
}
// 删除
export const reqDeleteDataTheme = (data: any): Promise<any> => {
  return datashopAxios({
    url: `/api/datashop/v3/data-topics/${data.id}`,
    method: 'delete',
    data
  })
}
